package org.asiainfo.system.domain.bo;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import org.asiainfo.system.domain.SysCategory;
import lombok.Data;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.EqualsAndHashCode;
import org.asiainfo.common.mybatis.stream.core.domain.BaseEntity;

/**
 * 业务对象 sys_category
 *
 * @author dotor-ww
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = SysCategory.class, reverseConvertGenerate = false)
public class SysCategoryBo extends BaseEntity {

    /**
     * 分类ID
     */
    private Long categoryId;
    /**
     * 父级ID
     */
    private Long parentId;
    /**
     * 祖级ID
     */
    private String ancestors;
    /**
     * 分类名称
     */
    @NotBlank(message = "分类名称不能为空")
    @Size(min = 0, max = 30, message = "分类名称长度不能超过{max}个字符")
    private String categoryName;
    /**
     * 分类编码
     */
    @NotBlank(message = "分类编码不能为空")
    @Size(min = 0, max = 100, message = "分类编码类型长度不能超过{max}个字符")
    @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "分类编码必须以字母开头，且只能为（小写字母，数字，下滑线）")
    private String categoryCode;
    /**
     * 描述信息
     */
    private String remark;
    /**
     * 删除标志（0存在 1删除）
     */
    private String delFlag;
}

